(function () {
    var EVENT_CLICK = Laya.Event.CLICK;
    var io = ppt.io;

    function propsTab(call) {
        propsTab.super(this);
        this.callback  = call;
        this.index = 0;
        this.init();
    }
    Laya.class(propsTab, "Com.Props.Tab", ui.Props.PropsTabUI);
    var _proto = propsTab.prototype;

    _proto.init = function () {
         this.propsTab.on(Laya.Event.CLICK,this,this.onPropsTabChange);
         this.finishing.on(Laya.Event.CLICK,this,this.finishingEd);
    }
    _proto.onPropsTabChange = function () {
        var selectedIndex = this.propsTab.selectedIndex;
            this.index = this.propsTab.selectedIndex;
            this._finish = false;
            io.emit({"cmd":"bag::getBag", params : {'type':(selectedIndex+1)}});
            this.callback(selectedIndex);
    }
    _proto.finishingEd = function () {
        io.emit({"cmd":"bag::sort", params : {'type':(this.index+1)}});
    }
})();